<%@ page import="gdepot.Cart" %>



<div class="fieldcontain ${hasErrors(bean: cartInstance, field: 'lineItems', 'error')} ">
	<label for="lineItems">
		<g:message code="cart.lineItems.label" default="Line Items" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${cartInstance?.lineItems?}" var="l">
    <li><g:link controller="lineItem" action="show" id="${l.id}">${l?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="lineItem" action="create" params="['cart.id': cartInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'lineItem.label', default: 'LineItem')])}</g:link>
</li>
</ul>


</div>

<div class="fieldcontain ${hasErrors(bean: cartInstance, field: 'status', 'error')} required">
	<label for="status">
		<g:message code="cart.status.label" default="Status" />
		<span class="required-indicator">*</span>
	</label>
	<g:select name="status" from="${gdepot.CartStatus?.values()}" keys="${gdepot.CartStatus.values()*.name()}" required="" value="${cartInstance?.status?.name()}" />

</div>

<div class="fieldcontain ${hasErrors(bean: cartInstance, field: 'user', 'error')} required">
	<label for="user">
		<g:message code="cart.user.label" default="User" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="user" name="user.id" from="${gdepot.Users.list()}" optionKey="id" required="" value="${cartInstance?.user?.id}" class="many-to-one"/>

</div>

